<div class="form">

<?php $form=$this->beginWidget('CActiveForm', array(
	'id'=>'portfolio-form',
	'enableAjaxValidation'=>false,
)); ?>

	<p class="note">Fields with <span class="required">*</span> are required.</p>

	<?php echo $form->errorSummary($model); ?>

	<div class="row">
		<?php echo $form->labelEx($model,'date'); ?>
		<?php $this->widget('zii.widgets.jui.CJuiDatePicker', array(
                'model' => $model,
                'attribute' => 'date',
                // additional javascript options for the date picker plugin
                'options' => array(
                    'showAnim' => 'fold',
                    'dateFormat' => 'dd/mm/yy',
                    'changeMonth' => true,
                    'changeYear' => true,
                    'yearRange' => '-20:+20',
                    'constrainInput' => true,
                ),
                'htmlOptions' => array(
                    'id' => 'datepicker'
                ),
            )); ?>
		<?php echo $form->error($model,'date'); ?>
	</div>

	<div class="row">
		<?php echo $form->labelEx($model,'companyID'); ?>
		<?php //echo $form->textField($model,'companyID'); ?>
		<?PHP echo $form->dropDownList($model,'companyID',$model->getCompany()); ?>
		<?php echo $form->error($model,'companyID'); ?>
	</div>

	<div class="row">
		<?php //echo $form->labelEx($model,'quantity'); ?>
		<?php //echo $form->textField($model,'quantity'); ?>
		<?php //echo $form->error($model,'quantity'); ?>
	</div>

	<div class="row">
		<?php //echo $form->labelEx($model,'price'); ?>
		<?php //echo $form->textField($model,'price'); ?>
		<?php //echo $form->error($model,'price'); ?>
	</div>

	<div class="row">
		<?php //echo $form->labelEx($model,'amount'); ?>
		<?php //echo $form->textField($model,'amount'); ?>
		<?php //echo $form->error($model,'amount'); ?>
	</div>

	<div class="row">
		<?php echo $form->labelEx($model,'quantity_m'); ?>
		<?php echo $form->textField($model,'quantity_m'); ?>
		<?php echo $form->error($model,'quantity_m'); ?>
	</div>

	<div class="row">
		<input name="Portfolio[price_m]" id="Portfolio_price_m" type="hidden" value="0">
		<input name="Portfolio[amount_m]" id="Portfolio_amount_m" type="hidden" value="0">
		<?php //echo $form->labelEx($model,'price_m'); ?>
		<?php //echo $form->textField($model,'price_m'); ?>
		<?php //echo $form->error($model,'price_m'); ?>
	</div>

	<div class="row">
		<?php //echo $form->labelEx($model,'amount_m'); ?>
		<?php //echo $form->textField($model,'amount_m'); ?>
		<?php //echo $form->error($model,'amount_m'); ?>
	</div>

	<div class="row">
		<?php //echo $form->labelEx($model,'type'); ?>
		<?php //echo $form->textField($model,'type'); ?>
		<?php //echo $form->error($model,'type'); ?>
		<?PHP
		$type_A=0;		
		echo "<input name=\"Portfolio[type]\" id=\"Portfolio_type\" value=\"$type_A\" type=\"hidden\">";
		?>
	</div>

	<div class="row">
		<?PHP echo "<input name=\"Portfolio[status]\" id=\"Portfolio_status\" value=\"2\" type=\"hidden\">"; ?>
		<?php //echo $form->labelEx($model,'status'); ?>
		<?php //echo $form->textField($model,'status'); ?>
		<?php //echo $form->error($model,'status'); ?>
	</div>

	<div class="row">
		<?php //echo $form->labelEx($model,'portfolionameID'); ?>
		<?php //echo $form->textField($model,'portfolionameID'); ?>
		<?php //echo $form->error($model,'portfolionameID'); ?>
		<input name="Portfolio[portfolionameID]" id="Portfolio_portfolionameID" type="hidden" value="<?PHP echo $_GET['port']; ?>">
	</div>

	<div class="row buttons">
		<?php echo CHtml::submitButton($model->isNewRecord ? 'Create' : 'Save'); ?>
	</div>

<?php $this->endWidget(); ?>

</div><!-- form -->